package com.project.server.service.operate.impl;

import com.project.common.core.domain.BaseServer;
import com.project.server.domain.operate.TOperateAdvertisement;
import com.project.server.mapper.operate.TOperateAdvertisementMapper;
import com.project.server.service.operate.ITOperateAdvertisementService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 运营管理广告Service业务层处理
 *
 * @author project
 * @date 2021-06-29
 */
@Service
public class TOperateAdvertisementServiceImpl extends BaseServer implements ITOperateAdvertisementService {

    private static final Logger log = LoggerFactory.getLogger(TOperateAdvertisementServiceImpl.class);

    @Resource
    private TOperateAdvertisementMapper tOperateAdvertisementMapper;

    /**
     * 查询运营管理广告
     *
     * @param advertisementId 运营管理广告ID
     * @return 运营管理广告
     */
    @Override
    public TOperateAdvertisement selectTOperateAdvertisementById(Long advertisementId) {
        return tOperateAdvertisementMapper.selectTOperateAdvertisementById(advertisementId);
    }

    /**
     * 查询运营管理广告列表
     *
     * @param tOperateAdvertisement 运营管理广告
     * @return 运营管理广告
     */
    @Override
    public List<TOperateAdvertisement> selectTOperateAdvertisementList(TOperateAdvertisement tOperateAdvertisement) {
        return tOperateAdvertisementMapper.selectTOperateAdvertisementList(tOperateAdvertisement);
    }

    /**
     * 新增运营管理广告
     *
     * @param tOperateAdvertisement 运营管理广告
     * @return 结果
     */
    @Override
    public int insertTOperateAdvertisement(TOperateAdvertisement tOperateAdvertisement) {
        super.insert(tOperateAdvertisement);
        return tOperateAdvertisementMapper.insertTOperateAdvertisement(tOperateAdvertisement);
    }

    /**
     * 修改运营管理广告
     *
     * @param tOperateAdvertisement 运营管理广告
     * @return 结果
     */
    @Override
    public int updateTOperateAdvertisement(TOperateAdvertisement tOperateAdvertisement) {
        super.update(tOperateAdvertisement);
        return tOperateAdvertisementMapper.updateTOperateAdvertisement(tOperateAdvertisement);
    }

    /**
     * 批量删除运营管理广告
     *
     * @param advertisementIds 需要删除的运营管理广告ID
     * @return 结果
     */
    @Override
    public int deleteTOperateAdvertisementByIds(Long[] advertisementIds) {
        return tOperateAdvertisementMapper.deleteTOperateAdvertisementByIds(advertisementIds);
    }

    /**
     * 删除运营管理广告信息
     *
     * @param advertisementId 运营管理广告ID
     * @return 结果
     */
    @Override
    public int deleteTOperateAdvertisementById(Long advertisementId) {
        return tOperateAdvertisementMapper.deleteTOperateAdvertisementById(advertisementId);
    }
}
